<%
  @cur_userid=session[:userid]
  @cur_username=session[:username]
if @cur_userid%>
	<fieldset class="fieldset">
		<legend><span><b>欢迎 <%=@cur_username%></b></span></legend>
		<ul>
			<li><a href="#">我发布注册码</a></li>
			<li><a href="#">我发布注册机</a></li>
			<li><a href="#">收藏夹</a></li>
			<li><%=link_to "退出",{},:href=>'javascript:void(0);',:onclick=>remote_function(:update=>'login',:method => "get",:url => {:controller=>:user,:action => :logout})%></li>
		</ul>
	</fieldset>
<%else%>
	<fieldset class="fieldset">
		<legend><span><b>用户登录</b></span></legend>
		<% form_remote_tag(:url=>{:controller=>:user,:action=>:login} ) do %>
		<ul>
			<li>
				用户名
				<%=text_field_tag(:name,nil,:class=>'w100')%>
			</li>
			<li>
				密　码
				<%=password_field_tag(:password,nil,:class=>'w100')%>
			</li>
			<li>
				<%=submit_tag("登录")%>
			</li>
		</ul>
		<div style="text-align:right;">
			<%=link_to h(">>注册新用户") ,{:controller=>:user,:action=>:reg}%>
		</div>
		<% end %>
	</fieldset>
<%end%>